#include<iostream>
#include<unordered_map>
using namespace std;
const int N = 1e5 + 10;
typedef long long LL;
LL n,sum;
unordered_map<LL, int> mp;

int main()
{
	cin >> n;
	int m = (n + 1) / 2;//至少两个数相加
	for (int i = 1;i <= m;i++)
	{
		sum += i;
		//看看有没有一段区间和为sum-n;
		
		if (mp.count(sum-n))
		{
			cout << mp[sum - n]+1 << " " << i << endl;
		}
		mp[sum] = i;
	}
	return 0;
}